<?php
require_once('Zend/Controller/Plugin/Abstract.php');

class ModuleLayout extends Zend_Controller_Plugin_Abstract 
 { 
	public function preDispatch(Zend_Controller_Request_Abstract $pRequest)
	{ 
		if(MODULE_TYPE == 'admin') {
			Zend_Layout::getMvcInstance()->setLayoutPath('../app_mvc/default/admin/layouts'); 
			Zend_Layout::getMvcInstance()->setLayout('default'); 
		} else {
			Zend_Layout::getMvcInstance()->setLayoutPath('../app_mvc/default/frontend/layouts'); 
			Zend_Layout::getMvcInstance()->setLayout('default'); 
		}
	} 
 } 
